Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor middleware hostname in Feed component #6538

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Nov 3, 2023

WHAT

🤖 Generated by Copilot at 8fba4f2

This pull request enhances the camera stream functionality by adding logic to handle different middleware server scenarios. It introduces new props, constants, and state variables to store and select the appropriate middleware hostname for each camera. It also updates the API calls and the UI components to use the new logic. It affects the files ONVIFCamera.tsx, Feed.tsx, and useMSEplayer.ts.

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

HOW

🤖 Generated by Copilot at 8fba4f2

  • Add middleware_address and location_middleware properties to ICameraAssetState interface to store the hostnames of the middleware servers for the camera stream and the location of the camera (link)
  • Define fallbackMiddleware and currentMiddleware constants to provide a default middleware hostname for the camera stream based on the availability of the middlewareHostname prop and the asset object in the ONVIFCamera component (link)
  • Use currentMiddleware constant instead of facilityMiddlewareHostname in the API calls to get the preset data and to pass the prop to the AddPresetModal component in the ONVIFCamera component (link, link)
  • Remove the definition of fallbackMiddleware constant from the ONVIFCamera component as it is now passed as a prop from the Feed component (link)
  • Rename cameraMiddlewareHostname state variable to facilityMiddlewareHostname and add middleware_address and location_middleware properties to cameraAsset state object to store the hostnames of the middleware servers for the camera stream and the location of the camera in the Feed component (link, link)
  • Set the value of facilityMiddlewareHostname state variable to the value of res.data.middleware_address in the API call to get the facility details in the Feed component (link)
  • Define fallbackMiddleware and currentMiddleware constants to provide a default middleware hostname for the camera stream based on the availability of the cameraAsset.middleware_address and the cameraAsset.location_middleware properties in the Feed component (link)
  • Use currentMiddleware constant instead of facilityMiddlewareHostname in the URL for the camera stream, the config object passed to the useMSEMediaPlayer hook, and the dependency array of the useEffect hook that calls the getBedPresets function in the Feed component (link, link, link)

@Ashesh3 Ashesh3 requested a review from a team November 3, 2023 12:10
@Ashesh3 Ashesh3 requested a review from a team as a code owner November 3, 2023 12:10
@Ashesh3 Ashesh3 requested a review from gigincg November 3, 2023 12:10
Copy link

vercel bot commented Nov 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 0:11am

Copy link

netlify bot commented Nov 3, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 8fba4f2
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6544e34f6cd64600082e0273
😎 Deploy Preview https://deploy-preview-6538--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nihal467
Copy link
Member

nihal467 commented Nov 3, 2023

LGTM

Copy link

cypress bot commented Nov 3, 2023

1 failed test on run #1512 ↗︎

1 81 0 0 Flakiness 0

Details:

Refactor middleware hostname in Feed component
Project: CARE Commit: 8fba4f271d
Status: Failed Duration: 04:06 💡
Started: Nov 3, 2023 12:15 PM Ended: Nov 3, 2023 12:19 PM
Failed  cypress/e2e/shifting_spec/filter.cy.ts • 1 failed test

View Output Video

Test Artifacts
Shifting section filter > filter by facility Test Replay Output Screenshots

Review all test suite changes for PR #6538 ↗︎

@khavinshankar khavinshankar merged commit 5891df3 into develop Nov 3, 2023
32 of 35 checks passed
@khavinshankar khavinshankar deleted the fix-location-override branch November 3, 2023 12:20
Copy link

github-actions bot commented Nov 3, 2023

@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Location middleware override is malfunctioning in the entire platform
3 participants